{extend name="base" /}
{block name="css"}
{css href="__CSS__/coupon.css" /}
{/block}
{block name="body"}
<!-- 主要内容 开始 -->
<div class="weui-tab__bd-item">
    <header class="weui-navBar weui-navBar-fixed">
        <a href="javascript:history.go(-1);" class="weui-navBar-item">
            <i class="icon iconfont icon-fanhui"></i>
        </a>
        <div class="weui-center">
            <span class="weui-center-title">领券中心</span>
        </div>
        <a href="javascript:;" class="weui-navBar-item actionsheet">
            <i class="icon iconfont icon-gengduo"></i>
        </a>
    </header>
    <div class="weui-tab">
      <div class="weui-tab__bd">
        	{volist name="data" id="v" empty="$empty"}
            <div class="aui-coupon-box">
              	<div class="aui-coupon-list">
    	            <div class="aui-coupon-list-flex">
    	                <div class="aui-coupon-list-flex-hd">
    	                    <h2> <i>￥</i> {$v.price}</h2>
    	                    <p>{if $v.condition gt 0}满￥{$v.condition}可用{else}无金额门槛{/if}</p>
    	                </div>
    	                <div class="aui-coupon-list-flex-bd">
    	                    <h3> <em>{if $v.type eq 1}现金{elseif $v.type eq 2}运费{elseif $v.type eq 3}积分{else}其他{/if}</em> {$v.name}优惠券</h3>
                            <span class="aui-flex-box">{if $v.source eq 1}新人专享{elseif $v.source eq 2}签到{elseif $v.source eq 3}购买商品{elseif $v.source eq 4}邀请新人{else}其他{/if}</span>
                            {if $v.cat_range}
                            <span class="aui-received"></span>
                            <button class="aui-vou-btn-der">去使用</button>
                            {else}
                            <button class="aui-vou-btn-der aui-vou-btn-der-one">立即领取</button>
                            {/if}
                            <p>{$v.end_time|date="Y.m.d"}<i>剩2天</i></p>
    	                </div>
    	            </div>
            	</div>
            </div>
        	{/volist}
        </div>
    </div>
</div>
<!-- 主要内容 结束 -->
{/block}
{block name="js"}
<script type="text/javascript">
  $(function () {
    $('.aui-vou-btn-der').click(function() {
        if ($(this).text() === '去使用') return $(location).attr('href', 'index.html');
        $.toast('领取成功','text');
    });
  });
</script>
{/block}